package org.thalien.roleplay.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;

import org.thalien.roleplay.database.CreateDatabase;

import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class CreateDatabaseServlet extends HttpServlet {

	private static final long serialVersionUID = -7293652218300132958L;
	
	@Inject
	private CreateDatabase createDatabase;

	@Override
	public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
		
		PrintWriter pw = response.getWriter();
		
		createDatabase.create(pw);
		
		pw.close();
	}

	
}
